<?php
include "konek.php";
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$bln = date('Y-m');
$a = 857;
$x=date("Y");
$cx2= $x.'-02';
$feb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx2%' and (status='Open' || status='Aktif') order by ticket_id desc");
//var_dump(mysql_fetch_array($jan));
$feb1=  mysql_fetch_array($feb);
$c = $feb1['FEB'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx3= $x.'-01';
$jan = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx3%' and (status='Open' || status='Aktif') order by ticket_id desc");
$jan1=  mysql_fetch_array($jan);
$s = $jan1['FEB'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx4= $x.'-03';
$mar = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx4%' and status='Open' order by ticket_id desc");
$mar1=  mysql_fetch_array($mar);
$e = $mar1['FEB'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx5= $x.'-04';
$apr = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx5%' and (status='Open' || status='Aktif') order by ticket_id desc");
$apr1=  mysql_fetch_array($apr);
$f = $apr['FEB'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx6= $x.'-05';
$mei = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx6%' and (status='Open' || status='Aktif') order by ticket_id desc");
$mei1=  mysql_fetch_array($mei);
$g = $mei11['FEB'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx7= $x.'-06';
$jun = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx7%' and (status='Open' || status='Aktif') order by ticket_id desc");
$jun1=  mysql_fetch_array($jun);
$h = $jun1['FEB'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx8= $x.'-07';
$jul = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx8%' and (status='Open' || status='Aktif') order by ticket_id desc");
$jul1=  mysql_fetch_array($jul);
$i = $jul1['FEB'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx9= $x.'-08';
$ag = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx9%' and (status='Open' || status='Aktif') order by ticket_id desc");
$ag1=  mysql_fetch_array($ag);
$j = $ag1['FEB'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx10= $x.'-09';
$oxt = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx10%' and (status='Open' || status='Aktif') order by ticket_id desc");
$oxt1=  mysql_fetch_array($oxt);
$kk = $oxt1['CANT'];
$k = $kk;
echo $cx10;
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx11= $x.-11;
$nop = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx11%' and (status='Open' || status='Aktif')  order by ticket_id desc");
$nop1=  mysql_fetch_array($nop);
$L = $nop1['FEB'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx12= $x.-12;
$des = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx12%' and (status='Open' || status='Aktif') order by ticket_id desc");
$des1=  mysql_fetch_array($des);
$d = $des1['CANT'];
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

$cx24= $x.-10;
$sep = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx24%' and (status='Open' || status='Aktif') order by ticket_id desc");
//var_dump(mysql_fetch_array($jan));
$fetch=  mysql_fetch_array($sep);
$jumlahrecord = $fetch['CANT'];
$b =$jumlahrecord;

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
echo $cx12;



echo "<graph caption=' Ticket Created' xAxisName='$bln' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'>";
echo "
	<set name='Jan' value='$s' color='AFD8F8' />
<set name='Feb' value='$c' color='F6BD0F' />
<set name='Mar' value='$e' color='8BBA00' />
<set name='Apr' value='$f' color='FF8E46'/>
<set name='May' value='$g' color='008E8E'/>
<set name='Jun' value='$h' color='D64646'/>
<set name='Jul' value='$i' color='8E468E'/>
<set name='Aug' value='$j' color='588526'/>
<set name='Sep' value='$k' color='B3AA00'/>
<set name='Oct' value='$b' color='008ED6'/>
<set name='Nov' value='$L' color='9D080D'/>
<set name='Dec' value='$d' color='A186BE'/>


";

echo "</graph>";


?>